package cn.tedu.review;

/**该类用于复习封装的方法
 * @author ：Dsi
 * @date ：2021/11/8 9:22
 */
public class TestStudent {
    public static void main(String[] args) {
        Student s=new Student();
        s.setAddress("太阳路");
        s.setName("晓阳");
        s.setSnu(212);
        System.out.println(s.getAddress());
        System.out.println(s.getName());
        System.out.println(s.getSnu());
        s.eat();
    }
}
class Student{
    private int snu;
    private String name;
    private String address;

    public int getSnu() {
        return snu;
    }
    public void setSnu(int snu) {
        this.snu = snu;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAddress() {
        return address;
    }
    public void setAddress(String address) {
        this.address = address;
    }

    private void study(){
        System.out.println("开始学习");
    }
    public void eat(){
        System.out.println("不吃饱哪有力气学习~~");
        study();
    }


}